<?php include template("header");?>

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="settings">
	<div class="dashboard" id="dashboard">
		<ul><?php echo current_account('cai-dat-tai-khoan'); ?></ul>
	</div>
    <div id="content" class="clear settings-box">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head"><h2>Cài đặt tài khoản</h2></div>
                <div class="sect">
                    <form id="settings-form" method="post" action="/account/settings.php" enctype="multipart/form-data" class="validator">
						<div class="wholetip clear"><h3>1、Thông tin tài khoản</h3></div>
                        <div class="field email">
                            <label>Email</label>
                            <input type="text" size="30" name="email" id="settings-email-address" class="f-input <?php echo $readonly['email']; ?>" <?php echo $readonly['email']; ?> value="<?php echo $login_user['email']; ?>" />
                        </div>
                        <div class="field">
                            <label>Hình đại diện</label>
							<?php if($login_user['avatar']){?>
							<img src="<?php echo user_image($login_user['avatar']); ?>" style="float:left;margin-top:-10px;margin-right:10px;"/>
							<?php }?>
                            <input type="file" size="30" name="upload_image" id="settings-avatar" class="f-input" />
                            <span class="hint">dung lượng <= 512KB </span>
                        </div>
                        <div class="field password">
                            <label>Đổi mật khẩu</label>
                            <input type="password" size="30" name="password" id="settings-password" class="f-input" />
                            <span class="hint">Nếu Bạn không muốn đổi mật khẩu, hãy để trống</span>
                        </div>
                        <div class="field password">
                            <label>Xác nhận mật khẩu</label>
                            <input type="password" size="30" name="password2" id="settings-password-confirm" class="f-input" />
                        </div>
                        <div class="field password">
                            <label>Giới tính</label>
							<select name="gender" class="f-city"><?php echo Utility::Option($option_gender, $login_user['gender']); ?></select>
                        </div>
                        <a name="contact"></a>
						<div class="wholetip clear"></div>
						<?php if((!$login_user['mobile'] || !$login_user['realname'] || !$login_user['address']) ){?>
						<div id="note"><ul style='padding-left: 50px;'>
						<label>Những thông tin này rất cần thiết để chúng tôi phục vụ Bạn tốt hơn.</label>
							<?php if(!$login_user['mobile'] ){?><li style='list-style: square outside none; padding-left: 7px;'>Số điện thoại<?php }?>
							<?php if(!$login_user['realname'] ){?><li style='list-style: square outside none; padding-left: 7px;'>Họ tên<?php }?>
							<?php if(!$login_user['address'] ){?><li style='list-style: square outside none; padding-left: 7px;'>Địa chỉ<?php }?>									
						</ul></div>
						<?php }?>
						<div class="wholetip clear"><h3>2、Thông tin liên hệ</h3></div>
                        <div class="field mobile">
                            <label>Điện thoại</label>
                            <input type="text" size="30" name="mobile" id="settings-mobile" class="number" value="<?php echo $login_user['mobile']; ?>" datatype="mobile|ajax" url="<?php echo $WEB_ROOT; ?>/ajax/validator.php" vname="signupmobile"  msg="Incorrect mobile number|The number has been registered" />
                            <span class="inputtip">Số điện thoại rất quan trọng, dùng để liên lạc với Bạn trong trường hợp cần thiết.</span>
                        </div>
                        <div class="field password">
                            <label>Yahoo ID</label>
                            <input type="text" size="30" name="qq" id="settings-qq" class="number" value="<?php echo $login_user['qq']; ?>" />
                        </div>
						<div class="field city">
                            <label>Thành phố</label>
							<select name="city_id" class="f-city"><?php echo Utility::Option(Utility::OptionArray($allcities, 'id', 'name'), $login_user['city_id']); ?><option value='0'>Others</option></select>
                        </div>
						<div class="wholetip clear"><h3>3、Thông tin nhận phiếu</h3></div>
                        <div class="field username">
                            <label>Họ & tên</label>
                            <input type="text" size="30" name="realname" id="settings-realname" class="f-input" value="<?php echo $login_user['realname']; ?>" />
                        </div>
                        <div class="field username">
                            <label>Địa chỉ</label>
                            <input type="text" size="30" name="address" id="settings-address" class="f-input" value="<?php echo $login_user['address']; ?>" />
                        </div>
						<div class="field">
                            <label>Mã vùng</label>
                            <input type="text" maxLength=6 size="10" name="zipcode" id="settings-zipcode" class="f-input number" value="<?php echo $login_user['zipcode']; ?>" />
                        </div>
                        <div class="clear"></div>
                        <div class="act">
                            <input type="submit" value="edit" name="Lưu thay đổi" id="settings-submit" class="formbutton"/>
                        </div>
                    </form>
                </div>
            </div>
            <div class="box-bottom"></div>
        </div>
    </div>
    <div id="sidebar" class="rail">
		<?php include template("block_side_credit");?>
		<?php include template("block_side_credittip");?>
    </div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<?php include template("footer");?>
